package br.com.simulado.application;

import java.util.LinkedHashMap;
import java.util.Map;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;

import br.com.simulador.session.StatusSimuladoList;

@Name("combosEstaticos")
@Install()
public class CombosEstaticos {
	
	@In(create=true)
	private StatusSimuladoList statusSimuladoList;
	
	/**
	 * Gera uma lista com valores de minutos de 0 até 2 horas
	 * @return
	 */
	@Factory(value="minutos", scope=ScopeType.APPLICATION)
	public Map<String, Integer> getMinutos(){
		Map<String, Integer> result = new LinkedHashMap <String, Integer>();
		for(int i=0; i<120; i++){
			String val = String.format("%02d:%02d",  (int)i / 60, i%60);
			result.put(val, i * 3600);
		}
		
		return result;
	}
	
	

	
}
